import Vue from 'vue'
import Router from 'vue-router'  // Vue 2

Vue.use(Router)

// 导入组件
import Home from '../view/home/index.vue'
import Analysis from "@/view/analysis/index.vue";
import Profile from "@/view/profile/index.vue";
import Dingwei from "@/view/home/life/dingwei/index.vue";
import SportModel from "@/view/home/sport/sportmodel/index.vue";
import Detail from "@/view/home/sport/sportmodel/detail/index.vue";

const router = new Router({
    mode: 'hash',
    routes: [
        {
            path: '/',
            redirect: '/home'
        },
        {
            path: '/home',
            name: 'Home',
            component: Home
        },
        {
            path: '/analysis',
            name: 'Analysis',
            component: Analysis
        },
        {
            path: '/profile',
            name: 'Profile',
            component: Profile
        },
        {
            path: '/dingwei',
            name: 'Dingwei',
            component: Dingwei,
        },
        {
            path: '/sportmodel',
            name: 'SportModel',
            component: SportModel,
        },
        {
            path: '/sportmodel/detail/:sport',
            name: 'Detail',
            component: Detail
        }
    ]
})

export default router
